home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / sw_41.zip / SW41DEMO.BAT < prev   
DOS Batch File  |  1991-12-01  |  7KB  |  253 lines

  1. @ECHO OFF
  2. rem A pre-SW screen just for effect
  3. rem make sure the screen is default white on black
  4. rem reset border
  5. sw /o
  6. rem save existing prompt
  7. set sav=%prompt%
  8. rem make sure there was room in environment
  9. if "%sav%"=="" goto skip
  10. set prompt=$e[0m$p$g
  11. @echo on
  12. cls
  13. @echo off
  14. echo.
  15. echo.
  16. echo.
  17. echo.
  18. echo.
  19. echo.
  20. echo.
  21. echo                           Are Your Batch Files Dull?
  22. echo.
  23. echo                                    Lifeless?
  24. echo.
  25. echo                                     Boring?
  26. echo.
  27. echo                              SW.EXE is the answer!
  28. echo.
  29. echo.
  30. echo.
  31. echo.
  32. echo.
  33. echo.
  34. echo.
  35. echo.
  36. pause
  37. set prompt=%sav%
  38. set sav=
  39.  
  40. :skip
  41. rem skip over screen definitions
  42. rem Put screen definitions at the beginning of the file for fastest execution
  43. goto begin
  44.  
  45. rem Screen definition with default label
  46. rem Windows are drawn in the order defined. Pause, Query and User Input will
  47. rem occur as they are encountered. SW will return only the last Query result.
  48.  
  49. :Display
  50. _window /kcya┼ /r2 /s /bred /w /0 /z
  51. SW.EXE - Expanded Text Handling!
  52. /tWHI+ Multiple Windows!
  53. /m  v 4.1 
  54. _window /r10 /s /bwhi /gblu /l1 /fred /0
  55. /tBLU Optional Command Line Syntax:
  56. SW @filename [label]
  57. _window /r16 /s /bwhi /gblu /l1 /fred /0
  58. /tBLU SW 4.x ADDITIONAL FEATURES
  59. /tred ───────────────────────────────────────────────────
  60. /jl - Define the entire screen with multiple windows
  61.   using external text files.
  62. _window /r25 /l0 /0 /p100- /d
  63. - Press any key for more -
  64. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  65. - Text handling can be expanded to 20 single-spaced
  66.   lines per window.
  67. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  68. - Using labels, more than one definition can be    
  69.   included in the same file.
  70. _window /r19 /bwhi /gblu /l0 /jl /0
  71. - The screen definition can be included inside the 
  72.   calling batch file!
  73. _window /r25 /l0 /0 /p200- /d
  74. - Press any key to continue -
  75. :end_display
  76.  
  77. rem screen definition showing a menu with user defined label
  78.  
  79. :menu
  80. _window /kmag╬ /r3 /s /bred /w /0 /z
  81. SW.EXE - New Sounds!
  82. /m " v 4.1 "
  83. _window /eRED /r12 /s /l1 /w
  84. /mc ┤ Play a Sound ├
  85. ~Low Tone   ~Mid Tone   ~High Tone
  86. Bweep ~1    Bweep ~2    ~Bomb     
  87. ~Siren      ~Phasor     ~Tweeter  
  88. ~E~S~C
  89. :end_menu
  90.  
  91. rem screen definition showing a menu with another user defined label
  92.  
  93. :4.1
  94. _window /kwhi░▒▓ /kBLA /r3 /s /bred /w /0 /o /z
  95. SW.EXE - No More Echoes!
  96. /m  v 4.1 
  97. _window /tRED /r11 /fWHI /s 
  98. They can also be placed anywhere on the screen they'll fit!
  99. _window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
  100. Upper Left
  101. _window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
  102. Upper Right
  103. _window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
  104. Lower Right
  105. _window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
  106. Lower Left
  107. _window /r19 /fWHI /tYEL+ /b4 /l5
  108.  (c) 1991   Warren Small
  109. _window /r25 /l0 /0 /p100-
  110.  - Pausing 10 seconds -
  111. _window /r25 /l0 /0 /p2
  112.  -      or less!      -
  113. :end_4.1
  114.  
  115. rem labels for Alert sounds demos near the beginning of file 
  116. rem for faster execution
  117.  
  118. :beep1
  119. sw /a1
  120. goto BeepDemo
  121.  
  122. :beep2
  123. sw /a2
  124. goto BeepDemo
  125.  
  126. :beep3
  127. sw /a3
  128. goto BeepDemo
  129.  
  130. :beep4
  131. sw /a4
  132. goto BeepDemo
  133.  
  134. :beep5
  135. sw /a5
  136. goto BeepDemo
  137.  
  138. :beep6
  139. sw /a6
  140. goto BeepDemo
  141.  
  142. :beep7
  143. sw /a7
  144. goto BeepDemo
  145.  
  146. :beep8
  147. sw /a8
  148. goto BeepDemo
  149.  
  150. :beep9
  151. sw /a9
  152.  
  153. :beepdemo
  154. sw /q`~lmh12bspt
  155. if errorlevel 9 goto beep9
  156. if errorlevel 8 goto beep8
  157. if errorlevel 7 goto beep7
  158. if errorlevel 6 goto beep6
  159. if errorlevel 5 goto beep5
  160. if errorlevel 4 goto beep4
  161. if errorlevel 3 goto beep3
  162. if errorlevel 2 goto beep2
  163. if errorlevel 1 goto beep1
  164. if errorlevel 0 goto DI
  165.  
  166. rem Command line examples, positioning, colors, shadows, pause, Wide edge
  167. rem Color numbers are used to shorten the line
  168. rem Command line cannot exceed 128 characters
  169.  
  170. :begin
  171. sw /kwhi /r2 /s /bred "SW.EXE - Enhance Your Batch Files!" /0 /w /m " v 4.1 " /o /z
  172. sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
  173. sw /r18 /l3 "With the command form" /t11 "Display up to 5 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
  174. sw /r25 /l0 /0 "- Press any key to continue -" /p100-
  175.  
  176. rem More command line examples, justify, borders
  177.  
  178. sw /kcya┼──── /r2 /s /bred "SW.EXE - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.1 " /z
  179. sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
  180. sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for texture" "& make windows with shadows." /0 /s
  181. sw /bwhi /r19 /gyel /l0 /0 /c4 /jl "Justify" "Text" "Left"
  182. sw /bwhi /r19 /gyel /l0 /0 /c66 /jr "Justify" "Text" "Right"
  183. sw /r25 /l0 /0 "- Press any key to continue -" /p100-
  184.  
  185. set colr=bla
  186. rem Make sure there was room in the environment
  187. if "%colr=="" goto next
  188.  
  189. rem Another command line example, Query with default, Border Message, Draw
  190. sw /kblu /r3 /s /bred "SW.EXE - Flow Control for BAT's!" /w /0 /m " v 4.1 " /z
  191.  
  192. rem The following line is longer than 128 characters BUT it works because 
  193. rem when the line is processed by DOS, the %colr% variable is replaced by
  194. rem the color value making the command line 3 characters shorter.
  195.  
  196. :colors
  197. sw /e12 /r13 /b%colr% /s /mc /t14 "▌ Pick a Color ▐" "~Brown  ~Cyan  ~White  ~Green" "Press ~E~S~C to go on..." /q`~bcwg /2 /l5 /d
  198.  
  199. if errorlevel 4 set colr=gre
  200. if errorlevel 4 goto colors
  201. if errorlevel 3 set colr=whi
  202. if errorlevel 3 goto colors
  203. if errorlevel 2 set colr=cya
  204. if errorlevel 2 goto colors
  205. if errorlevel 1 set colr=yel
  206. if errorlevel 1 goto colors
  207.  
  208. :next
  209. set colr=
  210.  
  211. rem Display screen definition with default label
  212. sw @sw41demo.bat
  213.  
  214. rem Display screen definition in external file
  215. sw @sw-41.new
  216.  
  217. rem Display screen definition with label 'menu'
  218. sw @sw41demo.bat menu
  219.  
  220. rem Query is handled separately beacause I wanted to return to the menu
  221. rem after processing the response without redoing the screen.
  222. rem I also placed it nearer the top of the file to speed it up.
  223. goto beepdemo
  224.  
  225. rem create screen definition on the fly to demo DI.EXE
  226. :DI
  227. sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
  228. echo rem This file was created by SW41DEMO.BAT > di.hlp
  229. echo rem If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
  230. echo rem                       "SW @DI.HLP" >> di.hlp
  231. echo.>> di.hlp
  232. echo :Display >> di.hlp
  233. echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
  234. echo SW.EXE - Now with DI!>> di.hlp
  235. echo /mc  v 4.1 >> di.hlp
  236. echo _window /jl /s /0 /r9 >> di.hlp
  237. echo /mc  Disk Information >> di.hlp
  238. echo.>> di.hlp
  239. di >> di.hlp
  240. echo. >> di.hlp
  241. echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
  242. echo - Press any key to continue - >> di.hlp
  243. echo :End_Display >> di.hlp
  244. sw @di.hlp
  245.  
  246. rem Display screen definition with label '4.1'
  247. :final
  248. sw @sw41demo.bat 4.1
  249.  
  250. rem display help screen
  251. :help
  252. sw
  253.